SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].gspCountry_SEARCH
(
@id int = null,
@name nvarchar(128) = null,
@isVisible bit = null
)
AS

SELECT
  *
FROM
  [dbo].[Country]
WHERE
  (@id IS NULL OR [Id] = @id)
AND
  (@name IS NULL OR @name = '' OR [Name] LIKE @name + '%')
AND
  (@isVisible IS NULL OR [IsVisible] = @isVisible)

GO
